package demo.swing.menu;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import demo.swing.administrator.EnterAdministrator;

public class MenuItemListener implements ActionListener {

	private EnterAdministrator enterAdministrator = null;
	private DemoMenu menu = null;
	public EnterAdministrator getEnterAdministrator() {
		return enterAdministrator;
	}
	public MenuItemListener(DemoMenu menu){
		this.menu = menu;
	}
	public DemoMenu getMenu() {
		return menu;
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		if (e.getSource() == menu.getAdministratorPanelMenuItem()){
			enterAdministrator = new EnterAdministrator("Log in!");	
		}else if (e.getSource() == menu.getExitMenuItem()){
			System.exit(0);
		}
		
	}

}
